<template>
	<view>
		<view class="size">
			请输入交易密码
		</view>

		<u-message-input :focus="true" ref="password" :maxlength="6" :dot-fill="true" class="fill" @finish="finish"></u-message-input>

	</view>
</template>

<script>
	import {mapState,mapMutations,mapActions} from 'vuex'
	import toast from '../../../utils/toast'
	export default {
		data() {
			return {

			}
		},
		components: {

		},
		methods: {
			...mapActions({
			confirm:'MAY_DEBT/CONFIRM'//确认交易密码	
			}),
			finish(e) {
			  this.confirm({id:this.id,pay_pwd:e}).then(res=>{
			if(res){
			 	toast.successTab('确认合约成功', '/pages/loanee/mayDebt/index')
			}else{
				this.$refs.password.valueModel="" 
			}
		})
			},
		},
		mounted() {

		},
		onLoad(options){
		 this.id=options.id	
		},
		watch: {

		},
		computed: {

		}
	}
</script>

<style scoped lang='scss'>
	.size {
		margin-left: 32rpx;
		margin-top: 32rpx;
	}

	.fill {
		margin-top: 68rpx;
	}
</style>
<style>
	page {
		background: #FAFAFA;
	}
</style>
